# coding: utf-8
import keyword

# 保留字查询 严格大小写
print(keyword.kwlist)
print(len(keyword.kwlist))

n = 8
print(n, type(n))
# 内存地址
print(n, id(n))

n = '而产生的'
print(n, type(n))
print(n, id(n))

num = 987
print(num)

# 二进制表示
num = 0b1010101
print(num)

# 八进制表示
num = 0o765
print(num)

# 十六进制表示
num = 0x87ABF
print(num)

# 复数类型
x = 123 + 456j
print("实数部分", x.real)
print("虚数部分", x.imag)

# 多行字符串
info = '''测试
阿萨大大
    ada
企鹅王
'''
print(info)

str = 'hello world'
print(str)
print(str[-1], str[2: 7], str[:7], str[2:])

print(str * 3)
print('world' in str)

# 布尔值
x = True
print(type(x), x + 10, False + 10)

# float 转 int
print(int(3.14), int(-4.14))

# int 转 float
print(float(3), float(-4))

# str 转 int
print(int('132') + int('243'))
# print(int('18a'))
# print(int('3.14'))
# print(float('18a.123'))

# chr ord
print(chr(65))
print(ord('A'))

print(24.5 // 2)

a, b = 10, 20
print(a, b)
a, b = b, a
print(a, b)

print(a > 15 and b > 15, a > 15 or b > 15, not (a > 15 and b > 15))